import axios from "axios";
const instanceEC = axios.create({
  baseURL: "https://api.vvhan.com",
  timeour: 5000,
});
function request(req) {
  //   if (req.url != "login") {
  //     instanceEC.interceptors.request.use((config) => {
  //       config.headers.Authorization = window.sessionStorage.getItem("token");
  //       return config;
  //     });
  //   }
  instanceEC.interceptors.response.use((res) => {
    return res.data;
  });
  return new Promise((resolve, reject) => {
    instanceEC(req)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
}
export default request;
